Use the REQUEST token exported from @nestjs/core along with @Inject(). The provider must be decorated with scope: Scope.REQUEST. For GraphQL contexts use the CONTEXT token from @nestjs/graphql instead.
HTTP — use REQUEST token from @nestjs/core; resolves to the Express or Fastify request object.
GraphQL — use CONTEXT token from @nestjs/graphql; resolves to the GraphQL execution context.
Microservices — REQUEST token resolves to the incoming message payload object.
WebSockets — REQUEST token resolves to the Socket client instance.